<%@ page pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="area" uri="http://ajaxanywhere.sourceforge.net/" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><fmt:message key="vipServiceVisitantList.title"/></title> 
<link rel="stylesheet" type="text/css" media="all"	href="<c:url value='/styles/layout.css'/>" />
<script src="<c:url value='/scripts/ajax/aa.js'/>"></script>
<script src="<c:url value='/scripts/common.js'/>"></script>
</head>
<body leftmargin="0" topmargin="0">
<html:form action="vipServiceVisitant.html?method=save"  method="post" styleId="vipServiceVisitantForm">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="44" class="home-content-title">
    <img src="images/home_ico_listTitle.gif" width="22" height="20" align="absmiddle">
    贵宾室服务</td>
  </tr>
  <tr>
    <td height="40" class="home-search-space">&nbsp;<fmt:message key="common.warning"/></td>
  </tr>
   <logic:messagesPresent >
		<tr id="messagesPresentTrId" style="display:;">
			<td valign="top" class="black12" height="20">
				<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
					<tr>
						<td class="arror_bg">
							<span class="arror_title">
						     您的操作存在如下错误：<br></span>
						     <html:errors/>
					    </td>
				    </tr>
			    </table>
			</td>
		</tr>
	</logic:messagesPresent>
  <tr>
  <tr id="messageTrId" style="display:none;">
	<td valign="top" class="black12">
	<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
	<td class="arror_bg_s">
	<span class="arror_title_s"> 
        保存信息成功!<br/>
     </span>
    </td>
    </tr>
    </table>
	</td>
	</tr>
  <tr>
    <td valign="top"> 
      <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td class="home-table-topline"> </td>
        </tr>
        <tr> 
          <td class="home-table-leftline"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-tool-content">
					<%-- <html:submit styleClass="home-inputBtn" property="method.save">
		            	保存
					</html:submit>--%>
					
					<input type="button" class="home-inputBtn" onclick="javascript:doCommit();" value="保存"
			 <logic:messagesNotPresent>
			 <c:if test="${('savesubmit' eq param.method)  || ('2' eq param.type)}">disabled</c:if> 
			 </logic:messagesNotPresent>
			 />
					
					<html:reset styleClass="home-inputBtn">
		            	重置
					</html:reset>
					
			 <input type="button" class="home-inputBtn"  onclick="doSubmit()" value="保存并提交"
			 <logic:messagesNotPresent>
			 <c:if test="${('savesubmit' eq param.method)  || ('2' eq param.type)}">disabled</c:if>
			 </logic:messagesNotPresent>
			 />
		        
				
				</td>
		       </tr>
             
              <tr>
                <td align="center" valign="top">&nbsp;</td>
              </tr>
              <tr> 
                <td valign="top" class="home-edittable-space">
                 <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td>
                      <c:import url="../../../vipServiceSheet.html?method=view&isInclude=yes&id=${vipServiceVisitantForm.vipServiceSheetId}"/>
                      </td>
                    </tr>
                    <tr> 
                      <td  align="center">
                       <table width="100%" border="0" cellspacing="0" cellpadding="0">
                       <tr>
                       <td align="left" class="home-table-tool-content">
                           历史投诉记录
                       </td>
                       <td align="right" class="home-table-tool-content">
                       <a href="./vipAppeal.html">
                       >>更多&nbsp;&nbsp;&nbsp;&nbsp;
                       </a>
                       </td>
                       </tr>
                       </table>  
                      </td>
                    </tr>

					<tr> 
						<td valign="top" class="home-tab-line"  align="center"> 
						<table width="100%" border="0" cellspacing="0" cellpadding="4">
						<tr> 
						  <td> 
							<input name="Submit2" type="button" class="home-inputBtn" value="新增" 
							onclick="javascript:vipAppealAdd();" <logic:messagesNotPresent>
							 <c:if test="${('savesubmit' eq param.method)  || ('2' eq param.type)}">disabled</c:if>
							 </logic:messagesNotPresent>/> 
						  </td>
						</tr>						
						<tr> 
						<td class="home-tab-list-bg">
						<area:zone name="vipAppealListArea"> 
							<table width="100%" border="0" cellspacing="1" cellpadding="2" class="home-subtable-bgcolor">
								
								<tr height=25> 
			                      <!--  
			                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipAppealForm.id"/></td>
			                      <td  width="20%" class="home-list-title">&nbsp;高端旅客档案_ID</td>
			                      <td  width="20%" class="home-list-title">&nbsp;高端旅客服务申请单_ID</td>-->
			                      <td  width="8%" class="home-table-tool-conten">&nbsp;日期</td>
			                      <td  width="8%" class="home-table-tool-conten">&nbsp;航班号</td>
			                      <td class="home-table-tool-conten">&nbsp;投诉内容</td>
			                      <td  width="8%" class="home-table-tool-conten">&nbsp;记录人</td>
			                      <!-- 
			                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipAppealForm.operateDate"/></td> -->
					              <!-- <td class="home-list-title"  width="50">&nbsp;<fmt:message key="button.view"/></td>	 -->
			                    </tr>
								
								<c:forEach var="results" items="${vipAppealList}" varStatus="status">
			                    <tr height=25>
			                      <!-- 
			                      <td class="home-list-content">&nbsp;<c:out value="${results.id}"/></td>
			                      <td class="home-list-content">&nbsp;<c:out value="${results.vipInfoId}"/></td>
			                      <td class="home-list-content">&nbsp;<c:out value="${results.vipServiceSheetId}"/></td> -->
			                      <td class="home-tab-content">&nbsp;<fmt:formatDate value="${results.appealDate}" pattern="yyyy-MM-dd"/></td>
			                      <td class="home-tab-content">&nbsp;<c:out value="${results.flightNum}"/></td>
			                      <td class="home-tab-content">&nbsp;<c:out value="${results.appealContent}"/></td>
			                       <td class="home-tab-content">&nbsp;<c:out value="${results.userName}"/></td>
			                      <!-- 
			                      <td class="home-tab-content">&nbsp;<c:out value="${results.operator}"/></td> -->
			                       <!-- 
			                      <td class="home-list-content">&nbsp;<c:out value="${results.operateDate}"/></td> -->
								   <!-- 
								    <td class="home-list-content" width="50">
								    	<img src="./images/view.gif" width="14" height="14" style="cursor:hand"  alt="<fmt:message key="button.view"/>"  onClick="MM_openBrWindow('./vipAppeal.html?method=view&id=<c:out value="${results.id}"/>','','width=500,height=400')">&nbsp;
								    </td> -->
			                    </tr>
		                       </c:forEach> 
							</table>
							</area:zone>
						</td>
						</tr>
						</table>
						</td>
					</tr>
					
					<tr> 
                      <td>&nbsp;</td>
                    </tr>
					
                    <tr> 
                      <td  align="center">
                       <table width="100%" border="0" cellspacing="0" cellpadding="0">
                       <tr>
                       <td align="left" class="home-table-tool-content">
                           贵宾室消费信息记录
                       </td>
                       <td align="right" class="home-table-tool-content">
                       <a href="./vipConsume.html">
                       >>更多&nbsp;&nbsp;&nbsp;&nbsp;
                       </a>
                       </td>
                       </tr>
                       </table>  
                      </td>
                    </tr>
					<tr> 
						<td valign="top" class="home-tab-line"  align="center"> 
						<table width="100%" border="0" cellspacing="0" cellpadding="4">
						<tr>&nbsp; 
							<input name="Submit2" type="button" class="home-inputBtn" value="新增" 
							onclick="javascript:vipConsumeAdd('');" <logic:messagesNotPresent>
							 <c:if test="${('savesubmit' eq param.method)  || ('2' eq param.type)}">disabled</c:if>
							 </logic:messagesNotPresent>/> 
							<input name="Submit2" type="button" class="home-inputBtn" 
							value="删除" onclick="doDelete('selected_id')" <logic:messagesNotPresent>
							 <c:if test="${('savesubmit' eq param.method)  || ('2' eq param.type)}">disabled</c:if>
							 </logic:messagesNotPresent>/> 
						</tr>						
						<tr> 
						<td class="home-tab-list-bg">
						<area:zone name="vipConsumeListArea"> 
							<table width="100%" border="0" cellspacing="1" cellpadding="2" class="home-subtable-bgcolor">
								<tr height=25> 
			                      <td width="5%" class="home-table-tool-conten"><div align="center"> 
			                          <input type="checkbox" name="checkbox" value="checkbox" onclick="chooseAll(this)" />
			                        </div></td>
			                      <!-- 
			                      <td  width="20%" class="home-table-tool-conten">&nbsp;<fmt:message key="vipConsumeForm.id"/></td>
			                      <td  width="20%" class="home-table-tool-conten">&nbsp;<fmt:message key="vipConsumeForm.vipInfoId"/></td>
			                      <td  width="20%" class="home-table-tool-conten">&nbsp;<fmt:message key="vipConsumeForm.vipServiceSheetId"/></td>
			                      <td  width="20%" class="home-table-tool-conten">&nbsp;consumeProductId</td> -->  
			                      <td  width="30%" class="home-table-tool-conten">&nbsp;消费项目</td>
			                      <td  width="30%" class="home-table-tool-conten">&nbsp;单价</td>
			                      <!-- 
			                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipConsumeForm.operator"/></td>
			                      <td  width="20%" class="home-list-title">&nbsp;<fmt:message key="vipConsumeForm.operateDate"/></td> -->
							      <td class="home-table-tool-conten" width="10%">&nbsp;编辑</td>
							      <!--  
							      <td class="home-table-tool-conten"  width="50">&nbsp;<fmt:message key="button.view"/></td>-->
			                    </tr>
			                    <c:forEach var="results" items="${vipConsumeList}" varStatus="status">
			                    <tr>
			                      <td class="home-tab-content" align="center">
			                        <input type="checkbox" name="selected_id" value="<c:out value='${results.id}'/>" />
			                      </td>
			                      <!-- 
			                      <td class="home-list-content">&nbsp;<c:out value="${results.id}"/></td>
			                      <td class="home-list-content">&nbsp;<c:out value="${results.vipInfoId}"/></td>
			                      <td class="home-list-content">&nbsp;<c:out value="${results.vipServiceSheetId}"/></td> 
			                      <td class="home-list-content">&nbsp;<c:out value="${results.consumeProductId}"/></td>-->
			                      <td class="home-tab-content">&nbsp;<c:out value="${results.consumeProductName}"/></td>
			                      <td class="home-tab-content">&nbsp;<c:out value="${results.consumeProductPrice}"/>.00</td>
			                      <!-- 
			                      <td class="home-list-content">&nbsp;<c:out value="${results.operator}"/></td>
			                      <td class="home-list-content">&nbsp;<c:out value="${results.operateDate}"/></td> -->
							    <td class="home-tab-content" width="50">
							    	<img src="./images/edit.gif" width="14" height="14" style="cursor:hand"  alt="<fmt:message key="button.edit"/>" onClick="javascript:vipConsumeAdd('<c:out value="${results.id}"/>');">&nbsp;
							    </td>
							   <!--
							    <td class="home-list-content" width="50">
							    	<img src="./images/view.gif" width="14" height="14" style="cursor:hand"  alt="<fmt:message key="button.view"/>"  onClick="MM_openBrWindow('./vipConsume.html?method=view&id=<c:out value="${results.id}"/>','','width=500,height=400')">&nbsp;
							    </td>   -->
			                    </tr>
					          </c:forEach> 
							</table>
						</area:zone>
						</td>
						</tr>
						</table>
						</td>
					</tr>


                    <tr>
						<td>
						<table width="100%" border="0" cellpadding="4" cellspacing="1" class="home-subtable-bgcolor">

							<html:hidden property="id"/>
							<html:hidden property="vipServiceSheetId"/>
							<tr>
							<td class="home-subtable-view-tdstyle-right">
							 &nbsp;<font color="red">*</font>旅客状态：
							</td>
							<td  class="home-subtable-view-tdstyle-left">
							<html:select name="vipServiceVisitantForm" property="visitantRoomStatus" size="1" styleId="visitantRoomStatus">
							 <html:option  value="">&nbsp;</html:option> 
							 <html:options collection="passengerStateList" property="name" labelProperty="name"/> 
							</html:select>
							</td>
							<td class="home-subtable-view-tdstyle-right"> 
							 &nbsp;<font color="red">*</font>贵宾室座位：
							</td>
							<td  class="home-subtable-view-tdstyle-left">
							<html:select name="vipServiceVisitantForm" property="visitantRoomSeat" size="1" styleId="visitantRoomSeat">
							 <html:option  value="">&nbsp;</html:option> 
							 <html:options collection="seatList" property="name" labelProperty="name"/> 
							</html:select>
							</td>
							</tr>
				
							<tr>
							<td class="home-subtable-view-tdstyle-right"> 
							 &nbsp;外貌特征
							</td>
							<td  class="home-subtable-view-tdstyle-left" colspan="3">
							<html:textarea property="visitantRoomFeature" 
							cols="74" rows="3"
							styleId="visitantRoomFeature" styleClass="home-table-inputbox" /> 
							
							</td>
							</tr>
				            </table>
						</td>
                    </tr>
                  </table> 
                  
                </td>
              </tr>
            </table>
		  </td>
        </tr>
        <tr> 
          <td height="12">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-bottom-left">&nbsp;</td>
                <td class="home-table-bottom-bg">&nbsp;</td>
                <td class="home-table-bottom-right">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table>
	  
	  </td>
  </tr>
  <tr>
    <td height="10">&nbsp;</td>
  </tr>
</table>
</html:form>
</body>
</html>
<script type="text/javascript">
//保存信息处理 
if("1"=='<c:out value="${flag}"/>'){
	//alert("保存信息成功!");
	var messageTrIdTd=document.getElementById("messageTrId");
	messageTrIdTd.style.display="";
	//window.location=window.location;  
}else if("-1"=='<c:out value="${flag}"/>'){
	alert("保存信息失败!");
	 
}else if("2" == '<c:out value="${flag}"/>'){
	window.location=window.location;  
}
</script>
<script type="text/javascript">
	function doCommit(){
		vipServiceVisitantForm.method="post";
		vipServiceVisitantForm.action="vipServiceVisitant.html?method=save&processinstid=<c:out value="${param.processinstid}"/>&workItemId=<c:out value="${param.workItemId}"/>&appId=<c:out value="${param.appId}"/>&vipServiceSheetId=<c:out value="${param.vipServiceSheetId}"/>";
		vipServiceVisitantForm.submit();
	}
//written by kellen 07-04-19

function doSubmit(){
		vipServiceVisitantForm.method="post";
		vipServiceVisitantForm.action="vipServiceVisitant.html?method=savesubmit&processinstid=<c:out value="${param.processinstid}"/>&workItemId=<c:out value="${param.workItemId}"/>&appId=<c:out value="${param.appId}"/>&vipServiceSheetId=<c:out value="${param.vipServiceSheetId}"/>";
		vipServiceVisitantForm.submit();
	}
function doDelete(chkName){  
		var selected = new Array(); 
		var val = "";	  
		   for (var i=0;i < document.forms[0].elements.length; i++){
				var e = document.forms[0].elements[i];  
				if (e.name==chkName){
					var chk = document.forms[0].elements[i];
					if(chk.checked){
						var bb = e.value; 
					    	selected.push(bb);
					    	break;
					} 
				}	 
			}	 
 		if(0!=selected.length){
 			if(confirm("<fmt:message key="common.confirm.message"/>")){  
				document.forms[0].method="post";
				document.forms[0].action="./vipConsume.html?method=delete"+"&fromWhere=visitant"
				+"&vipServiceSheetId=<c:out value="${vipServiceVisitantForm.vipServiceSheetId}"/>";
				document.forms[0].submit();
			}else return;	  			
		}else{
			alert("<fmt:message key="common.delete.message"/>");
		}	 
	}
	
function areaRefresh(area){ 
    //alert(area);
	ajaxAnywhere.getZonesToReload = function() {
    return area;
	}
    //ajaxAnywhere.onGetAjaxNotSupported('./vipServiceVisitant.html?method=edit&vipServiceSheetId=<c:out value="${vipServiceVisitantForm.vipServiceSheetId}"/>');
	ajaxAnywhere.getAJAX('./vipServiceVisitant.html?method=edit&vipServiceSheetId=<c:out value="${vipServiceVisitantForm.vipServiceSheetId}"/>');
	//ajaxAnywhere.submitAJAX(); 
	//ajaxAnywhere.dropPreviousRequest();

	
}

function vipAppealAdd(){
var  top= (screen.availHeight/2)-(250/2);   
var  left= (screen.availWidth/2)-(500/2);
var status='top='+top+',left='+left+',height=250,width=500,status=no,toolbar=no,menubar=no,location=no'; 
var vipInfoIdTxt=document.getElementById("vipInfoId");
var url="./vipAppeal.html?method=edit"+
   "&fromWhere=visitant&vipServiceSheetId=<c:out value='${vipServiceVisitantForm.vipServiceSheetId}'/>"
   +"&vipInfoId="+vipInfoIdTxt.value;
window.open(url,'complain',status);

}

function vipConsumeAdd(id){
var  top= (screen.availHeight/2)-(200/2);   
var  left= (screen.availWidth/2)-(400/2);
var status='top='+top+',left='+left+',height=200,width=400,status=no,toolbar=no,menubar=no,location=no'; 
var url='';
var vipInfoIdTxt=document.getElementById("vipInfoId");
//alert(vipInfoIdTxt.value);
if(id!='')url='./vipConsume.html?method=edit&fromWhere=visitant&id='+id;
else
 url='<c:url value="/vipConsume.html?method=edit'+
'&fromWhere=visitant&vipServiceSheetId=${vipServiceVisitantForm.vipServiceSheetId}'+
'&vipInfoId='+vipInfoIdTxt.value+'"/>';
window.open(url,null,status);
}
</script>


